from threading import Thread
import time
import os


def func():
    for i in range(3):
        time.sleep(2)
        print("thread")
        print(os.getpid())


start = time.time()
t = Thread(target=func)
t.start()
t.join()
final = time.time()
print(final-start)
